let fs=require('fs');

fs.writeFile('test.txt','hello world\n',{flag:'a'},function(err,data){
	if(err){
		throw err;
	}
	console.log('written')
	fs.readFile('test.txt','utf-8',function(err,data){
		if(err){
			throw err;
		}
		console.log(data.toString());
	});
	// fs.readFileSync();
});
// fs.writeFileSync();
// fs.appendFile();
// fs.appendFileSync();
